//
//  RSDBDatabase.h
//  Cellar Tracker
//
//  Created by Johnnie Walker on 09/07/2008.
//  Copyright 2008 Random Sequence. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FMDatabase.h"

@class RSDBResultSet;
@interface RSDBDatabase : FMDatabase {
	NSURL *databaseURL;
}
@property (nonatomic, retain) NSURL *databaseURL;

-(RSDBResultSet *)tables;
-(RSDBResultSet *)schemaForTable:(NSString *)tableName;

-(void)setUserVersion:(int)userVersion;
-(int)userVersion;

-(BOOL)tableExists:(NSString *)tableName;

/* 
	Query & Update Methods 
	Note: Update only uses the first query in the SQL. Aggregate updates could be done, see:
	http://www.sqlite.org/c3ref/prepare.html
*/

- (BOOL) executeUpdate:(NSString *)sql arguments:(NSArray *)args;
- (BOOL) executeUpdate:(NSString*)sql, ...;

- (id) executeQuery:(NSString *)sql arguments:(NSArray *)args;
- (id) executeQuery:(NSString*)sql, ...;

- (FMStatement *)statementFromSQL:(NSString *)sql;
@end
